-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
[Feat][KV offload][WIP] Separated process for CPU KV cache processing #22607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: ApostaC <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a separate process for CPU KV cache management, which is a significant architectural change. The implementation establishes the communication protocol and server structure using ZMQ. My review focuses on the completeness and robustness of this new component.
I've identified several areas where the implementation is incomplete, particularly concerning the 'onload' functionality, which is part of the feature's scope but not fully implemented in the protocol or server logic. Additionally, there are inconsistencies in logging practices, where print
is used instead of the configured logger, which can hinder debugging and monitoring in production environments. These issues are critical to address to ensure the feature is robust and maintainable.
ONLOAD_REQUEST = enum.auto() | ||
ONLOAD_FINISHED = enum.auto() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The KVServerCmd
enum includes ONLOAD_REQUEST
and ONLOAD_FINISHED
, but the corresponding message structures (e.g., KVServerOnloadRequest
, KVServerOnloadFinished
) are not defined. This incompleteness prevents the implementation of the onload functionality and will cause decode_payload
to fail for these commands. Please define the necessary msgspec.Struct
classes for onload operations and integrate them into the protocol, including the KVServerMsg
union.
|
||
def scheduler_process_response(socket: zmq.Socket, | ||
finished_offloads: list[str], | ||
finished_onloads: list[str]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The finished_onloads
parameter is unused because the function does not handle ONLOAD_FINISHED
commands, despite the docstring indicating it should. This suggests the feature implementation is incomplete. Please add logic to process onload responses and populate this list, which will also require defining the ONLOAD_FINISHED
message in protocol.py
.
def handle_onload_request(self, client_id, cmd, payload): | ||
print("Received onload request from:", client_id) | ||
|
||
# TODO: Do something here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Yihua Cheng <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Yihua Cheng <[email protected]>
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
Essential Elements of an Effective PR Description Checklist
supported_models.md
andexamples
for a new model.Purpose
This PR is part of #22605
It introduces the structure of the CPU KV manager process and how the scheduler should talk with the process.
Test Plan
Test Result
(Optional) Documentation Update